<template>

  <div id="app">
    <div class="header"  v-if="$route.name!='login'">
        <van-icon v-if="$route.name!='index'"  @click="back()" name="arrow-left" ></van-icon>
        <span v-if="$route.name!='index'" class="pageTitle">{{title}}</span>
         <span v-else>{{title}}</span>
    </div>
    <router-view></router-view>
  </div>
</template>
<script>
export default {
  name: 'App',
  components: {
  },
  data () {
    return {
      musicSrc: 'https://cdn2.pluslegal.cn/faku/bgMusic.mp3',
      title:'法库智慧云端'   
    };
  },
  methods: {
    back: function () {
      this.$router.back()
    },

  },
  mounted () {
    // this.$refs.bgmusic.showPlayer(true)


  },
  beforeDestroy () {

  },
  watch: {
    $route: {
      handler (val) {
        if (val.query.title == '' || val.query.title == null) {
          this.title = '法库智慧云端'
        } else {
          this.title = val.query.title;
        }
      },
      deep: true,
    }
  },
}



</script>

